package com.woniuxy02;

import java.util.Scanner;

/**
 * @author 作者
 * @create 2025-07-16 16:46
 */
public class Test11 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("输入一个数字");
        int number = sc.nextInt();
        //true是质数
        boolean flag=true;
        int i=2;
        //17   2-16
        while(i<=number-1){
            if(number%i==0){
                flag=false;
                break;
            }
            i++;
        }

        //下结论
        if(flag){
            System.out.println("是质数");
        }else{
            System.out.println("不是质数");
        }
        System.out.println("程序结束");
    }
}
